COMPILE_OPTS =		$(INCLUDES) -I. -O -DSOCKLEN_T=socklen_t
C =			c
C_COMPILER =		gcc
C_FLAGS =		$(COMPILE_OPTS) -DUSE_OUR_BZERO=1 -D__CYGWIN__
CPP =			cpp
CPLUSPLUS_COMPILER =	c++
CPLUSPLUS_FLAGS =	$(COMPILE_OPTS) -Wall -DBSD=1
OBJ =			o
LINK =			c++ -o 
LINK_OPTS =		-L.
CONSOLE_LINK_OPTS =	$(LINK_OPTS)
LIBRARY_LINK =		ld -o 
LIBRARY_LINK_OPTS =	$(LINK_OPTS) -r -Bstatic
LIB_SUFFIX =			a
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
EXE =
##### End of variables to change

LIVEMEDIA_DIR = liveMedia
LIVEMEDIA_LIB = $(LIVEMEDIA_DIR)/libliveMedia.$(LIB_SUFFIX)
GROUPSOCK_DIR = groupsock
GROUPSOCK_LIB = $(GROUPSOCK_DIR)/libgroupsock.$(LIB_SUFFIX)
USAGE_ENVIRONMENT_DIR = UsageEnvironment
USAGE_ENVIRONMENT_LIB = $(USAGE_ENVIRONMENT_DIR)/libUsageEnvironment.$(LIB_SUFFIX)
BASIC_USAGE_ENVIRONMENT_DIR = BasicUsageEnvironment
BASIC_USAGE_ENVIRONMENT_LIB = $(BASIC_USAGE_ENVIRONMENT_DIR)/libBasicUsageEnvironment.$(LIB_SUFFIX)

TESTPROGS_DIR = testProgs
TESTPROGS_APP = $(TESTPROGS_DIR)/testMP3Streamer$(EXE)

MEDIA_SERVER_DIR = mediaServer
MEDIA_SERVER_APP = $(MEDIA_SERVER_DIR)/mediaServer$(EXE)

ALL =	$(LIVEMEDIA_LIB) \
	$(GROUPSOCK_LIB) \
	$(USAGE_ENVIRONMENT_LIB) \
	$(BASIC_USAGE_ENVIRONMENT_LIB) \
	$(TESTPROGS_APP) \
	$(MEDIA_SERVER_APP)
all:	$(ALL)


$(LIVEMEDIA_LIB):
	cd $(LIVEMEDIA_DIR) ; $(MAKE)
$(GROUPSOCK_LIB):
	cd $(GROUPSOCK_DIR) ; $(MAKE)
$(USAGE_ENVIRONMENT_LIB):
	cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE)
$(BASIC_USAGE_ENVIRONMENT_LIB):
	cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE)
$(TESTPROGS_APP): $(LIVEMEDIA_LIB) $(GROUPSOCK_LIB) $(USAGE_ENVIRONMENT_LIB) $(BASIC_USAGE_ENVIRONMENT_LIB)
	cd $(TESTPROGS_DIR) ; $(MAKE)
$(MEDIA_SERVER_APP): $(LIVEMEDIA_LIB) $(GROUPSOCK_LIB) $(USAGE_ENVIRONMENT_LIB) $(BASIC_USAGE_ENVIRONMENT_LIB)
	cd $(MEDIA_SERVER_DIR) ; $(MAKE)

clean:
	cd $(LIVEMEDIA_DIR) ; $(MAKE) clean
	cd $(GROUPSOCK_DIR) ; $(MAKE) clean
	cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) clean
	cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) clean
	cd $(TESTPROGS_DIR) ; $(MAKE) clean
	cd $(MEDIA_SERVER_DIR) ; $(MAKE) clean
